import { alova } from '@/service/request';

/** get Column page */
export function paginateColumn(params?: Api.SearchParams) {
  return alova.Get<Api.PageRow>('/cms/column/paginate', {
    params
  });
}

/** get all Column */
export function listColumn() {
  return alova.Get<Api.Row[]>('/cms/column/list');
}

/** create Column */
export function createColumn(data?: Api.Model) {
  return alova.Post<boolean>('/cms/column/create', data);
}

/** update Column */
export function updateColumn(data?: Api.Model) {
  return alova.Post<boolean>('/cms/column/update', data);
}

/** delete Column */
export function deleteColumn(params: Api.DeleteParams) {
  return alova.Post<boolean>('/cms/column/delete', undefined, { params });
}

/** delete Column */
export function batchDelColumn(params: Api.BatchDeleteParams) {
  return alova.Post<boolean>('/cms/column/batchDel', undefined, { params });
}

export function treeColumn(params?: Api.SearchParams) {
  return alova.Get<Api.Node>('/cms/column/tree', {
    params,
    cacheFor: null
  });
}
